package com.zengguang.testkaoshi.services.impl;

import com.zengguang.testkaoshi.dao.TestpaperDao;
import com.zengguang.testkaoshi.pojo.Testpaper;
import com.zengguang.testkaoshi.services.ITestpaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TestpaperService implements ITestpaperService {
    @Autowired
    private TestpaperDao testpaperDao;
    @Override
    public int insertTestpaper(Testpaper testpaper) {
        int returnInt=0;
        int addAnswerInt=testpaperDao.insertTestpaper(testpaper);
        returnInt=addAnswerInt;
        return returnInt;
    }

    @Override
    public int updateTestpaper(Testpaper testpaper) {
        int returnInt=0;
        int addAnswerInt=testpaperDao.updateTestpaper(testpaper);
        returnInt=addAnswerInt;
        return returnInt;
    }

    @Override
    public List<Testpaper> selectAllTestpaper() {
        List<Testpaper> list=testpaperDao.selectAllTestpaper();
        return list;
    }

    @Override
    public int deleteTestpaper(int testpaperid) {
        int returnInt=0;
        int addAnswerInt=testpaperDao.deleteTestpaper(testpaperid);
        returnInt=addAnswerInt;
        return returnInt;
    }
}
